package com.example.test1.mapper;
import com.example.test1.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
public interface MessageInfoMapper {
    //插入数据
    @Insert("insert into message_info (`from`,`to`,`message`) values (#{from},#{to},#{message})")
    Integer insertMessage(MessageInfo messageInfo);
    //查询所有数据
    @Select("select * from message_info where delete_flag=0")
    List<MessageInfo> selectAllList();
}
